import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:oi_ai_tool/util/string_extention.dart';

defalutIconTheme() {
  return IconThemeData(color: Colors.cyan.shade300, size: 20.sp);
}

defalutThemeBorder() {
  return OutlineInputBorder(
      borderSide: BorderSide(color: Colors.cyan.shade600, width: 1.sp),
      gapPadding: 1.sp,
      borderRadius: BorderRadius.all(Radius.circular(20.r)));
}

focusBorderTheme() {
  return OutlineInputBorder(
      borderSide: BorderSide(color: Colors.cyan.shade700, width: 1.sp),
      gapPadding: 1.sp,
      borderRadius: BorderRadius.all(Radius.circular(20.r)));
}

errorBorderTheme() {
  return OutlineInputBorder(
      borderSide: BorderSide(color: Colors.red.shade500, width: 1.sp),
      gapPadding: 1.sp,
      borderRadius: BorderRadius.all(Radius.circular(20.r)));
}

ThemeData oiThemeData() {
  return ThemeData(
    // primaryTextTheme: TextTheme(),

    drawerTheme: DrawerThemeData(backgroundColor: "#ffffff".toColor()),
    scaffoldBackgroundColor: Colors.grey.shade100,
    cupertinoOverrideTheme: CupertinoThemeData(
        applyThemeToAll: true,
        primaryColor: Colors.cyan.shade500,
        scaffoldBackgroundColor: Colors.grey.shade100),
    primaryColor: Colors.cyan.shade100,
    primaryIconTheme: defalutIconTheme(),
    iconTheme: defalutIconTheme(),
    bottomAppBarTheme: const BottomAppBarTheme(
        color: Colors.white24, padding: EdgeInsets.zero, elevation: 0),
    inputDecorationTheme: InputDecorationTheme(
        hoverColor: Colors.cyan.shade600,
        focusColor: Colors.cyan.shade700,
        contentPadding: EdgeInsets.fromLTRB(10.sp, 0, 10.sp, 0),
        outlineBorder: BorderSide(color: Colors.cyan.shade600, width: 1),
        focusedErrorBorder: errorBorderTheme(),
        focusedBorder: focusBorderTheme(),
        enabledBorder: defalutThemeBorder(),
        border: defalutThemeBorder()),
    bottomNavigationBarTheme: BottomNavigationBarThemeData(
        elevation: 0,
        selectedIconTheme: IconThemeData(size: 35.sp, fill: 0.9),
        unselectedIconTheme: IconThemeData(size: 30.sp, color: Colors.white),
        backgroundColor: Colors.cyan.shade100,
        selectedItemColor: Colors.cyan.shade600),
    navigationBarTheme: NavigationBarThemeData(
      backgroundColor: Colors.cyan.shade100,
      height: 50.sp,
    ),
    floatingActionButtonTheme: FloatingActionButtonThemeData(
      backgroundColor: Colors.cyan.shade50,
    ),
    appBarTheme: AppBarTheme(
        backgroundColor: Colors.cyan.shade100,
        centerTitle: true,
        titleTextStyle:
            TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600)),
    colorScheme: ColorScheme.fromSeed(seedColor: Colors.cyan),
    useMaterial3: true,
  );
}
